package vn.anhqn.englishsentensetranslator.base.fragment;

import vn.anhqn.englishsentensetranslator.R;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

public abstract class FragmentHaveSlidingMenu extends BaseAppFragment implements OnClickListener {
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		setEnableSlidingMenu(true);
		setLeftHeaderIcon(R.drawable.menu_ic);
		getLeftHeaderIcon().setOnClickListener(this);
		return super.onCreateView(inflater, container, savedInstanceState);
	}
	
	
	public abstract void onClickView(View v);
	@Override
	public void onClick(View v) {
		int idView = v.getId();
		if (idView == getLeftHeaderIcon().getId())
			getSlidingMenu().toggle();
		onClickView(v);
	}

}
